export function timestampToTime(timestamp) {
  let now = new Date(timestamp * 1000);
  let year = now.getFullYear();
  let month = now.getMonth() + 1;
  let date = now.getDate();
  let hour = now.getHours();
  let minute = now.getMinutes();
  let second = now.getSeconds();
  return (
    year + "-" + month + "-" + date + "   " + hour + ":" + minute + ":" + second
  );
}
export function timestamp() {
  let now = new Date();
  let year = now.getFullYear();
  let month = now.getMonth() + 1;
  let date = now.getDate();
  let hour = now.getHours();
  let minute = now.getMinutes();
  let second = now.getSeconds();
  return (
    year + "-" + month + "-" + date + "   " + hour + ":" + minute + ":" + second
  );
}
export function yearNow(){
  let now = new Date();
  let year = now.getFullYear();
  return year;
}
export function monthNow(){
  let now = new Date();
  let month = now.getMonth() + 1;
  return month;
}
export function dateNow(){
  let now = new Date();
  let date = now.getDate();
  return date;
}
export function isNull(data){
  return data === undefined || data === null;
};

export function isEmpty (data){
  return data === undefined || data === null || data.length <= 0; 
};
export function notEmpty  (data){
  return !this.isEmpty(data)
};
export function isTrue (data){
  return data !== undefined && data; 
};
export function imageShow(url){
  if(isEmpty(url)){
    return require("../assets/logo.png")
  }
  if (url.includes("http")){
    return require(url)
  }
  return require("../assets/" + url)
}